package io.gitee.geminidev.bot.domain;

import java.io.File;

/**
 * @Author widthwu
 * @Date 2023/4/2 12:35
 * @description: 消息通用参数
 */
public class MessageResponse {

    public static MessageResponse create(){
        return new MessageResponse();
    }

    /**
     * 消息内容，文本内容，支持内嵌格式
     */
    private String content;

    /**
     * Embed消息，一种特殊的 ark，详情参考Embed消息
     */
    private MessageEmbed embed;

    /**
     * Ark消息对象
     */
    private MessageArk ark;

    /**
     * 引用消息对象
     */
    private MessageReference messageReference;

    /**
     * 图片url地址，平台会转存该图片，用于下发图片消息
     */
    private String image;

    private File fileImage;

    /**
     * 要回复的消息id(Message.id), 在 AT_CREATE_MESSAGE 事件中获取。
     */
    private String msgId;

    /**
     * 要回复的事件id, 在各事件对象中获取。
     */
    private String eventId;

    /**
     * Markdown消息对象
     */
    private MessageMarkdown markdown;

    // Getters and Setters
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    public MessageEmbed getEmbed() {
        return embed;
    }
    public void setEmbed(MessageEmbed embed) {
        this.embed = embed;
    }
    public MessageArk getArk() {
        return ark;
    }
    public void setArk(MessageArk ark) {
        this.ark = ark;
    }
    public String getImage() {
        return image;
    }
    public void setImage(String image) {
        this.image = image;
    }
    public MessageMarkdown getMarkdown() {
        return markdown;
    }
    public void setMarkdown(MessageMarkdown markdown) {
        this.markdown = markdown;
    }

    public String getMsgId() {
        return msgId;
    }

    public void setMsgId(String msgId) {
        this.msgId = msgId;
    }

    public String getEventId() {
        return eventId;
    }

    public void setEventId(String eventId) {
        this.eventId = eventId;
    }

    public MessageResponse content(String message){
        setContent(message);
        return this;
    }

    public MessageResponse messageReference(String message_id){
        MessageReference reference = new MessageReference();
        reference.setMessage_id(message_id);
        setMessageReference(reference);
        return this;
    }

    public MessageReference getMessageReference() {
        return messageReference;
    }

    public void setMessageReference(MessageReference messageReference) {
        this.messageReference = messageReference;
    }

    public File getFileImage() {
        return fileImage;
    }

    public void setFileImage(File fileImage) {
        this.fileImage = fileImage;
    }

    public MessageResponse fileImage(File fileImage){
        setFileImage(fileImage);
        return this;
    }
}
